#include <47func.h>
#include <mysql/mysql.h>
int main(){
    MYSQL *db = mysql_init(NULL);//NULL表示自动分配内存
    const char *host = "localhost";
    const char *user = "root";
    const char *password = "123";
    const char *database = "47test";
    MYSQL * ret = mysql_real_connect(db,host,user,password,database,0,NULL,0);
    if(ret == NULL){
        printf("Error:%s\n", mysql_error(db));
        return -1;
    }
    // 准备好sql语句
    const char *sql = "update event set type = 'vet' where type = '123';";
    int qret = mysql_query(db,sql);
    if(qret != 0){
        printf("SQL error:%s\n", mysql_error(db));
        return -1;
    }
    mysql_close(db);
}
